//
//  Test44.cpp
//  CPPTest
//
//  Created by you5 Yi on 2021/9/29.
//

#include "Test44.hpp"
#include <string>
#include <iostream>
using namespace std;
class Student {
private:
    char name[255];
    int score[10];
public:
    Student(char n[],int s[])
    {
        strcpy(name, n);
        for (int i=0; i<10; i++) {
            score[i]=s[i];
        }
    }
    void Show() {
        int sum = 0;
        for (int i=0; i<10; i++) {
            sum +=score[i];
        }
        cout<<"名字："<<name<<"，平均成绩："<<sum/10;
    }
};

void test44() {
    char name[255];
    int score[10];
    cout<<"姓名：";
    cin>>name;
    for (int i=0; i<10; i++) {
        cout<<"成绩"<<i+1<<"：";
        cin>>score[i];
    }
    Student s(name, score);
    s.Show();
}
